﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    private SqlConnection cnn;
    private SqlCommand cmd;
    private String strSQL, strcnntring;
    private SqlDataAdapter daSanpham;
    private DataSet dsSanpham;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        strcnntring = ConfigurationManager.ConnectionStrings["CSDL"].ConnectionString;
        int C_ID = int.Parse(Request.QueryString["C_ID"].ToString());
        cnn = new SqlConnection(strcnntring);
        strSQL = "select * from PRODUCT where P_CATEGORY=" + C_ID;
        daSanpham = new SqlDataAdapter(strSQL, cnn);
        dsSanpham = new DataSet();
        daSanpham.Fill(dsSanpham,"PRODUCT");
        ddlSanpham.DataSource = dsSanpham;
        ddlSanpham.DataBind();
    }
}